package br.com.pontoe.controller.action;

import java.sql.SQLException;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import br.com.pontoe.model.entidades.Funcionario;
import br.com.pontoe.model.persistencia.FuncionarioDAO;

public class PesquisarFuncionarioAction implements Action{

	public ActionResult execute(HttpServletRequest req, HttpServletResponse res) {
		ActionResult result = new ActionResult();
		
		
		try {
			List<Funcionario> funcionarios= new FuncionarioDAO().localizarTodos();
			result.getParametros().put("funcionarios", funcionarios); 

			result.setUrl("/PesquisarFuncionario.jsp");			
			}		
			catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		
		return result;

	}
	
	
	
}
